<%@ page import="com.macrosolution.exdebito.FileDocument" %>

<div class="col col-md-8 col-md-offset-1">
<fieldset>
	<section class="col-6">
		<label for="file" class="input input-file">
			<div class="button"><input type="file" name="file" onchange="this.parentNode.nextSibling.value = this.value">Browse</div><input type="text" placeholder="Aggiungi un File" readonly="">
		</label>
	</section>
	<section>
		
		<div class="input-group">
				<span class="input-group-addon"><i class="fa fa-folder-open-o fa-lg fa-fw"></i></span>
				<g:select 
						class="form-control " 
						id="documentType" 
						name="documentType.id" 
						from="${com.macrosolution.exdebito.DocType.findAllByDocumentCategory(1)}" 
						optionKey="id" 
						required="" 
						value="${fileDocumentInstance?.documentType?.id}"
						optionValue="documentType" 
				/>
			</div>
	
	
	</section>

		<section>
			<label class="textarea"> <i class="icon-append fa fa-comment"></i>
				<textarea rows="5" name="comments" maxlength="150"
					placeholder="Inserisci un commento al tuo file"></textarea>
			</label>
		</section>

		<footer>
		<i id="load_er" style="display:none" class="fa fa-gear fa-4x fa-spin"></i>
<%--		<g:submitToRemote url="[action: 'upload', controller:'FileDocument']"  name="upload" class="btn btn-primary" value="${message(code: 'Uploadee', default: 'Uploadee')}" />--%>
			<g:submitButton name="upload" class="btn btn-primary" onclick="er_go()" value="${message(code: 'Upload', default: 'Upload')}" />
	           <button type="button" class="btn btn-default" onclick="window.history.back();">
									Indietro
								</button>
								
<%--				<button type="button" class="btn btn-default" onclick="remot();">--%>
<%--									aj--%>
<%--				</button>--%>
		</footer>

	</fieldset>
	

</div>








<%--			<div class="${hasErrors(bean: fileDocumentInstance, field: 'comments', 'error')} ">--%>
<%--				<label for="comments" class="control-label"><g:message code="fileDocument.comments.label" default="Comments" /></label>--%>
<%--				<div>--%>
<%--					<g:textField class="form-control" name="comments" value="${fileDocumentInstance?.comments}"/>--%>
<%--					<span class="help-inline">${hasErrors(bean: fileDocumentInstance, field: 'comments', 'error')}</span>--%>
<%--				</div>--%>
<%--			</div>--%>

<%--			<div class="${hasErrors(bean: fileDocumentInstance, field: 'documentType', 'error')} required">--%>
<%--				<label for="documentType" class="control-label"><g:message code="fileDocument.documentType.label" default="Document Type" /><span class="required-indicator">*</span></label>--%>
<%--				<div>--%>
<%--					<g:select class="form-control" id="documentType" name="documentType.id" from="${com.macrosolution.exdebito.DocType.list()}" optionKey="id" required="" value="${fileDocumentInstance?.documentType?.id}" class="many-to-one"/>--%>
<%--					<span class="help-inline">${hasErrors(bean: fileDocumentInstance, field: 'documentType', 'error')}</span>--%>
<%--				</div>--%>
<%--			</div>--%>

<%--			<div class="${hasErrors(bean: fileDocumentInstance, field: 'fileName', 'error')} ">--%>
<%--				<label for="fileName" class="control-label"><g:message code="fileDocument.fileName.label" default="File Name" /></label>--%>
<%--				<div>--%>
<%--					<g:textField class="form-control" name="fileName" value="${fileDocumentInstance?.fileName}"/>--%>
<%--					<span class="help-inline">${hasErrors(bean: fileDocumentInstance, field: 'fileName', 'error')}</span>--%>
<%--				</div>--%>
<%--			</div>--%>
<%----%>
<%--			<div class="${hasErrors(bean: fileDocumentInstance, field: 'filePath', 'error')} ">--%>
<%--				<label for="filePath" class="control-label"><g:message code="fileDocument.filePath.label" default="File Path" /></label>--%>
<%--				<div>--%>
<%--					<g:textField class="form-control" name="filePath" value="${fileDocumentInstance?.filePath}"/>--%>
<%--					<span class="help-inline">${hasErrors(bean: fileDocumentInstance, field: 'filePath', 'error')}</span>--%>
<%--				</div>--%>
<%--			</div>--%>
<%----%>
<%--			<div class="${hasErrors(bean: fileDocumentInstance, field: 'fileSize', 'error')} required">--%>
<%--				<label for="fileSize" class="control-label"><g:message code="fileDocument.fileSize.label" default="File Size" /><span class="required-indicator">*</span></label>--%>
<%--				<div>--%>
<%--					<g:field class="form-control" name="fileSize" type="number" value="${fileDocumentInstance.fileSize}" required=""/>--%>
<%--					<span class="help-inline">${hasErrors(bean: fileDocumentInstance, field: 'fileSize', 'error')}</span>--%>
<%--				</div>--%>
<%--			</div>--%>
<%----%>
<%--			<div class="${hasErrors(bean: fileDocumentInstance, field: 'file_estension', 'error')} ">--%>
<%--				<label for="file_estension" class="control-label"><g:message code="fileDocument.file_estension.label" default="Fileestension" /></label>--%>
<%--				<div>--%>
<%--					<g:textField class="form-control" name="file_estension" value="${fileDocumentInstance?.file_estension}"/>--%>
<%--					<span class="help-inline">${hasErrors(bean: fileDocumentInstance, field: 'file_estension', 'error')}</span>--%>
<%--				</div>--%>
<%--			</div>--%>
<%----%>
<%--			<div class="${hasErrors(bean: fileDocumentInstance, field: 'user', 'error')} required">--%>
<%--				<label for="user" class="control-label"><g:message code="fileDocument.user.label" default="User" /><span class="required-indicator">*</span></label>--%>
<%--				<div>--%>
<%--					<g:select class="form-control" id="user" name="user.id" from="${com.macrosolution.exdebito.User.list()}" optionKey="id" required="" value="${fileDocumentInstance?.user?.id}" class="many-to-one"/>--%>
<%--					<span class="help-inline">${hasErrors(bean: fileDocumentInstance, field: 'user', 'error')}</span>--%>
<%--				</div>--%>
<%--			</div>--%>
<%----%>
